<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateLotteryRecordsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('lottery_records', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('user_id',false,true)->default(0)->comment('用户id');
            $table->integer('match_id',false,true)->default(0)->comment('比赛id');
            $table->string('sp1',18)->default('')->comment('不让球赔率');
            $table->string('sp2',18)->default('')->comment('让球赔率');
            $table->string('result',12)->default('')->comment('推荐结果,1胜2平3负4让胜5让平6让负');
             $table->float('pay_score',4,2)->default(1)->comment('推荐时支付积分');
            $table->float('odds',5,2)->default(0)->comment('最终赔率');
            $table->tinyInteger('status')->default(1)->comment('状态,-1删除0禁用1正常');
            $table->timestamps();
            $table->index('user_id');
        });
        \Illuminate\Support\Facades\DB::statement("ALTER TABLE `lottery_records` comment '推荐记录'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('lottery_records');
    }
}
